<?php
/**
 * YouNet
 *
 * @category   Application_Extensions
 * @package    Adv Notification
 * @copyright  Copyright 2011 YouNet Developments
 * @license    http://www.modules2buy.com/
 * @version    $Id: menu auctions
 * @author     Minh Nguyen
 */
class Advmenusystem_Widget_AdvmenuMiniController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {
        $this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();
        $this->view->navigation = $navigation = Engine_Api::_()
          ->getApi('menus', 'advmenusystem')
          ->getNavigation('advmenusystem_mini');
        $require_check = Engine_Api::_()->getApi('settings', 'core')->core_general_search;
        if(!$require_check){
          if( $viewer->getIdentity()){
            $this->view->search_check = true;
          }
          else{
            $this->view->search_check = false;
          }
        }
        else $this->view->search_check = true;
        if( $viewer->getIdentity() )
        {
          $this->view->notificationCount = Engine_Api::_()->getDbtable('notifications', 'activity')->hasNotifications($viewer);
          $this->view->messageCount = Engine_Api::_()->messages()->getUnreadMessageCount($viewer);
        }
        $request = Zend_Controller_Front::getInstance()->getRequest();
        $this->view->notificationOnly = $request->getParam('notificationOnly', false);
        $this->view->updateSettings = Engine_Api::_()->getApi('settings', 'core')->getSetting('core.general.notificationupdate');
  }
}